package com.cci.kangdao.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.cci.kangdao.service.TypicalCaseService;
import com.cci.kangdao.utilTool.ParameterTool;

/**
 * 典型案例接口
 * @author fengshuai
 *
 */
@Controller
public class TypicalCaseController {
	private  Logger log = Logger.getLogger(this.getClass().getName());
	
	@Autowired
	private TypicalCaseService typicalCaseService;
	/**
	 * App用户获取典型案例接口
	 */
	@RequestMapping("/getTypicalCase.aspx")
	public ModelAndView getTypicalCase(HttpServletRequest request, HttpServletResponse response) {
		try {
			Map<String, Object> map = ParameterTool.getParameterRequest(request, true);
			map.put("request", request);
			map.put("response", response);
			return typicalCaseService.getTypicalCase(map);
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			String msg = "{\"status\":-99,\"msg\":\"未知错误\"}";
			ParameterTool.writeResponse(response, msg);
		}
		return null;
	}
}
